package cn.snowheart.ssm.util;

import cn.snowheart.ssm.pojo.RestResponse;

/**
 * @author liuwanxiang
 * @version 2018/4/22
 */
public class ResponseUtil {

    public static <T> RestResponse<T> success(T result) {
        return new RestResponse<>(true, result);
    }

    public static <T> RestResponse<T> success() {
        return new RestResponse<>(true, null);
    }

    public static <T> RestResponse<T> error(T result) {
        return new RestResponse<>(false, result);
    }

    public static <T> RestResponse<T> error() {
        return new RestResponse<>(false, null);
    }

}
